import time
import pytest
from page.Page import Page
from selenium import webdriver


@pytest.fixture(scope='class')
def driver():
    driver = webdriver.Edge()
    driver.get('https://www.so.com/')
    driver.implicitly_wait(10)
    driver.maximize_window()
    yield driver
    time.sleep(2)
    driver.quit()

def test_01_search(driver):
    po = Page(driver)
    print(po.search_index_is())
    po.send_search_index()
    time.sleep(2)
    po.click_search_bot()
    print(po.get_one_text())
    assert "软件测试" in po.get_one_text()
    time.sleep(2)
    po.click_goto_tow()
    time.sleep(2)
    print(po.get_tow_text())
    assert "软件测试" in po.get_tow_text()
